Skip to content

Conversation

@bogdan-stacks
Copy link

This PR adds a clarity-wasm feature flag for certain Clarity1 errors as the WASM and interpreter error behaviors differ slightly, even though they represent the same underlying meaning.

Closes: stx-labs/clarity-wasm#702

@bogdan-stacks bogdan-stacks requested a review from a team as a code owner December 1, 2025 16:36
@bogdan-stacks bogdan-stacks changed the title add feature flag for specific errors Fix wasm-issue#702 add feature flag Dec 1, 2025
@codecov
Copy link

codecov bot commented Dec 1, 2025

Codecov Report

❌ Patch coverage is 0% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 27.59%. Comparing base (6e2efe2) to head (f8bcecf).

Files with missing lines Patch % Lines
stackslib/src/chainstate/stacks/db/transactions.rs 0.00% 24 Missing ⚠️

❌ Your project check has failed because the head coverage (27.59%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@                      Coverage Diff                      @@
##           feat/clarity-wasm-develop    #6726      +/-   ##
=============================================================
- Coverage                      30.91%   27.59%   -3.32%     
=============================================================
  Files                            572      572              
  Lines                         358768   358773       +5     
=============================================================
- Hits                          110903    99015   -11888     
- Misses                        247865   259758   +11893     
Files with missing lines Coverage Δ
stackslib/src/chainstate/stacks/db/transactions.rs 4.83% <0.00%> (-0.61%) ⬇️

... and 160 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6e2efe2...f8bcecf. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines 9745 to 9753
if cfg!(feature = "clarity-wasm") {
assert!(err_str
.find("TypeError(CallableType(Trait(TraitIdentifier")
.is_some());
} else {
assert!(err_str
.find("TypeValueError(OptionalType(CallableType(Trait(TraitIdentifier")
.is_some());
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the procedure is identical with both features, how about having a variable that would contain the expected error string, and then call assert!(err_str.find(expected_err).is_some()).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking more of something like:

let expected_err = if cfg!(...) {...} else {...};
assert!(err.str.contains(expected_err));

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's way cleaner, changed it. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants